<!DOCTYPE html>
<html>
<head>
    <title>文章 - 我的 beego 博客</title>
    {{template "header" .}}
</head>
<body>
{{template "navbar" .}}
<div class="container">
    <div class="page-header"></div>
    {{$Labels:= .Labels}}
    {{with .Topic}}
        <h1>{{.Title}}</h1>
        <a href="/topic/modify/{{.Id}}">修改文章</a><br>
        {{range $Labels}}
            <a href="/?label={{.}}">{{.}}</a>
        {{end}}
        <h6 class="text-muted">文章发表于 {{.Created}}, 共有 {{.Views}} 浏览， {{.ReplyCount}} 个评论</h6>
        {{.Content}}
        <h5> 文章附件(<a href="/attachment/{{.Id}}/{{.Attachment}}">{{.Attachment}}</a>)</h5>
    {{end}}
</div>
<div class="container">
    {{$tid:=.Topic.Id}}
    {{$IsLogin:=.IsLogin}}
    {{range .Replies}}
        <h3>{{.Nickname}}
            <small>{{.Created}} {{if $IsLogin}}<a href="/reply/delete?tid={{$tid}}&id={{.Id}}">删除</a>{{end}}</small>
        </h3>
        {{.Content}}
    {{end}}
    <h3>本文回复</h3>
    <form method="post" action="/reply/add">
        <input type="hidden" name="tid" value="{{.Topic.Id}}"/>
        <div class="form-group">
            <label>显示昵称：</label>
            <input type="text" class="form-control" name="nickname">
        </div>
        <div class="form-group">
            <label>内容：</label>
            <textarea name="content" cols="30" rows="10" class="form-control"></textarea>
        </div>
        <button type="submit">提交回复</button>
    </form>
</div>

<script type="text/javascript" src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
</body>
</html>